import { handleDeciveInfo } from "@/common/util";
import { useEffect, useState } from "react";


const useInitAction=()=>{
     const [placeHolderHeight, setPlaceHolderHeight] = useState(0);
    
        const [bottomSafeHeight, setBottomSafeHeight] = useState<number>(0)
           const [barTop, setBarTop] = useState(0);
       
       
        const handleDeceiveAppInfo= () => {
            const deceiveInfo = handleDeciveInfo();
    
            setBarTop(deceiveInfo.statusBarHeight)
    
            setPlaceHolderHeight(deceiveInfo.navBarHeight)
            setBottomSafeHeight(deceiveInfo.bottomSafeHeight)
        }
        
    
        useEffect(() => {
            handleDeceiveAppInfo()
           
        }, [])
        return {
            placeHolderHeight,
            bottomSafeHeight,
            barTop
        }
}
export default useInitAction;